
<template>
  <div class="app-container">
    <div class="filter-container">
      <el-input v-model="queryParam.module" placeholder="模块" clearable class="filter-item form-search-input"></el-input><el-input v-model="queryParam.operate" placeholder="操作" clearable class="filter-item form-search-input"></el-input>
      <el-button class="filter-item search" icon="el-icon-search" @click="handleSearch">
        搜索
      </el-button>
      <el-button class="filter-item" icon="el-icon-refresh" @click="handleRefresh">
        重置
      </el-button>
      <el-button class="filter-item fr" type="primary" icon="el-icon-plus" @click="handleCreate()">
        新增
      </el-button>
      <el-button v-if="this.selectedIds.length" size="small" class="filter-item mb-5" type="danger" icon="el-icon-delete" @click="handleMultiDelete">
        批量删除
      </el-button>
    </div>
    <el-table ref="multipleTable" :data="data" tooltip-effect="dark" style="width: 100%" border fit @selection-change="handleSelectMulti">
      <el-table-column type="selection" width="55"></el-table-column>
      <el-table-column label="模块" prop="module"></el-table-column><el-table-column label="操作" prop="operate"></el-table-column>
      <el-table-column prop="creator" label="创建人"></el-table-column>
      <el-table-column prop="created_at" label="创建时间"></el-table-column>
      <el-table-column prop="updated_at" label="更新时间"></el-table-column>
      <el-table-column label="操作">
        <template slot-scope="module">
          <el-button type="primary" icon="el-icon-edit" @click="handleUpdate(module.row)"></el-button>
          <el-button type="danger" icon="el-icon-delete" @click="handleDelete(module.row.id)"></el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="paginate.current" hide-on-single-page :page-sizes="paginate.sizes" :page-size="paginate.limit" :layout="paginate.layout" :total="paginate.total"></el-pagination>
    <!----------------------------------- 编辑 ---------------------------------------------->
    <el-dialog :title="title" :visible.sync="formVisible" @close="handleCancel">
      <el-form :ref="formName" :model="formFieldsData" :rules="rules">
        <el-form-item label="模块" :label-width="formLabelWidth" prop="module">
          <el-input v-model="formFieldsData.module" placeholder="模块" autocomplete="off" clearable></el-input>
        </el-form-item><el-form-item label="操作" :label-width="formLabelWidth" prop="operate">
          <el-input v-model="formFieldsData.operate" placeholder="操作" autocomplete="off" clearable></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="handleCancel">取 消</el-button>
        <el-button type="primary" @click="handleSubmit">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  import formOperate from '@/layout/mixin/formOperate'

  export default {
    name:'test_test',
    mixins: [formOperate],
    data() {
      return {
        formName: 'test',
        formLabelWidth: '120px',
        // 用户搜索
        queryParam: {
          module:'',operate:'',
        },
        formVisible: false,
        formFieldsData: {
          module:'',operate:'',
        },
        url: 'test',
        // 表单验证
        rules: {
        }
      }
    }
  }
</script>
